import { Controller, Get, Param } from '@nestjs/common';
import { ProductService } from '../service/product.service';
import { ProductDto } from '../dto/product.dto';

@Controller('products')
export class ProductController {
  constructor(private readonly productService: ProductService) {}

  @Get()
  findAll(): ProductDto[] {
    return this.productService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string): ProductDto {
    return this.productService.findOne(id);
  }
}